﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Elements.Links
{
    /// <summary>
    /// 直线连线定义
    /// </summary>
    public class LineLinkV5 : LinkBaseV4
    {
        public override void Draw(Graphics g)
        {
            Pen pen = new Pen(BackgroundColor, 2)
            {
                Alignment = PenAlignment.Center,
                CustomEndCap = new AdjustableArrowCap(6, 6, true)
                {
                    MiddleInset = 2f,
                },
            };

            var startPoint = StartShape.GetLinkPoint(StartShapeLinkPoint);
            var endPoint = EndShape.GetLinkPoint(EndShapeLinkPoint);

            g.DrawLine(pen, startPoint, endPoint);
        }
    }
}
